package lex.mtd.utils;

public class PercentFormatter {
	/**
	 * @param percent
	 *            0.0f~1.0f
	 * @return
	 */
	public static String format(double percent) {
		if (percent <= 0d)
			return "0%";
		else if (percent >= 1d)
			return "100%";
		StringBuilder buf = new StringBuilder();
		buf.append(Math.round(percent * 1000) / 10);
		buf.append('%');
		return buf.toString();
	}
}
